cmake_minimum_required(VERSION 3.3)
project(D2Hackmap LANGUAGES C CXX ASM_MASM)

if (MSVC)
    set(CompilerFlags
        CMAKE_CXX_FLAGS
        CMAKE_CXX_FLAGS_DEBUG
        CMAKE_CXX_FLAGS_RELEASE
        CMAKE_C_FLAGS
        CMAKE_C_FLAGS_DEBUG
        CMAKE_C_FLAGS_RELEASE
        )
    foreach(CompilerFlag ${CompilerFlags})
        string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17")
    endforeach()
endif(MSVC)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

add_definitions(-D_WIN32_WINNT=0x0601)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)

aux_source_directory(d2hackmap/. SRC_LIST)

message(${SRC_LIST})

add_library(
    D2Hackmap
    SHARED
    ${SRC_LIST}
)
